Skip to content

FreeBSD crc32 cap detection for arm64 - #4922

Closed
devnexen wants to merge 1 commit into
php:masterfrom
devnexen:crc32_detection_fbsd
Closed

FreeBSD crc32 cap detection for arm64#4922
devnexen wants to merge 1 commit into
php:masterfrom
devnexen:crc32_detection_fbsd

Conversation

@devnexen

Copy link
Copy Markdown
Member

No description provided.

@iluuu1994 iluuu1994 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM otherwise.

Comment thread ext/standard/crc32.c
# if defined(HWCAP_CRC32)
zend_long crc32 = 0;
if (elf_aux_info(AT_HWCAP, &crc32, sizeof(crc32)) == 0)
res = crc32 & HWCAP_CRC32;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

res isn't returned here. This will only work on the second run.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah I forgot about this one but a lot had changed since and it s an useless change now, FreeBSD uses a wrapper to be closer to Linux.

Comment thread ext/standard/crc32.c
if (res != -1)
return res;
# if defined(__linux__)
# if defined(HWCAP_CRC32)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Should be indented.

@devnexen devnexen closed this Dec 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants